//
//  TextbookQuestionsModel.h
//  Learn
//
//  Created by 迟建国 on 2024/4/3.
//  strongright © 2024 迟建国. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class HSResource;
@class HSItem;
@class HSQuestion;
@class HSQuestionOption;
@class HSValue;
@class HSValueAttachment;
@class HSQuestionTextModule;
@class HSTrunk;
@class HSScore;
@class HSTemplateSettings;
@class HSListeningAndSpeakingRule;
@class HSResourceH5;
@class HSPart;
@class HSChild;
@class HSChildAttachment;
@class HSPurpleOption;
@class HSRefInfo;
@class HSPurpleTextModule;
typedef enum : NSUInteger {
    answer_step_title_read=0,
    answer_step_look_question,
    answer_step_read_content,
    answer_step_wait_read,
    answer_step_read_sub_question,
    answer_step_answe_sub_questionr_record,
    answer_step_sub_wait_read,
    answer_step_answer_record,
    answer_step_answer_record_finished,
} answer_step;

@interface HSResource : NSObject
@property (nonatomic, assign) NSInteger totalScore;
@property (nonatomic, assign) NSInteger limitTime;
@property (nonatomic, strong) NSString *versionId;
@property (nonatomic, strong) NSString *moduleId;
@property (nonatomic, strong) NSMutableArray<HSItem *> *items;
@end

@interface HSItem : NSObject
@property (nonatomic, strong) HSTemplateSettings *templateSettings;
@property (nonatomic, strong)   NSMutableArray<HSScore *> *scores;
@property (nonatomic, strong)   NSMutableArray<HSQuestion *> *questions;

//
@property (nonatomic, strong)  NSString *recordPath;
@property (nonatomic, strong)  NSString *recordUrl;

@property (nonatomic, assign) BOOL isRead;

@property (nonatomic, assign) double fullscore;

@property (nonatomic, assign) double getScore;

@property (nonatomic, strong)  NSMutableArray *viewModel;

@end

@interface HSQuestion : NSObject  // 问题
@property (nonatomic, assign)         NSInteger type;
@property (nonatomic, strong)           NSString *versionId;
@property (nonatomic, strong)           NSString *moduleId;
@property (nonatomic, assign)         NSInteger is_objective;
@property (nonatomic, strong)         HSTrunk *trunk; // 题干
@property (nonatomic, strong)           NSArray<HSQuestionOption *> *options; // 选项
@property (nonatomic, strong)           NSString *sort;
@property (nonatomic, strong)           NSMutableArray<HSQuestion *> *children;
@property (nonatomic, strong)           NSMutableArray<HSQuestionTextModule *> *textModule;
@property (nonatomic, strong)  NSString *endAudioUrl;
@property (nonatomic, strong)  NSString *answerAudioUrl;
@property (nonatomic, strong)  NSString *recordPath;
@property (nonatomic, strong)  NSString *recordUrl;

@property (nonatomic, strong)  NSString *answer;

@property (nonatomic, assign)  double score;

@property (nonatomic, assign)  double questionRefSorce;

@property (nonatomic, assign)  double totalScore;

@property (nonatomic, assign)  double standardscore;

@property (nonatomic, assign)  double integrityscore;//完整度分

@property (nonatomic, assign)  double fluencyscore;//流畅度分

@property (nonatomic, assign)  double accuracyscore;//准确度分
@end

@interface HSQuestionOption : NSObject
@property (nonatomic, strong)   NSString *id;
@property (nonatomic, assign) NSInteger isAnswer;
@property (nonatomic, strong)   NSString *sort;
@property (nonatomic, strong)   NSMutableArray<HSValue *> *value;
@end

@interface HSValue : NSObject
@property (nonatomic, strong) NSString *body;
@property (nonatomic, strong) NSString *content_id;
@property (nonatomic, strong) NSMutableArray<HSValueAttachment *> *attachments;
@end

@interface HSValueAttachment : NSObject
@property (nonatomic, strong)   NSString *id;
@property (nonatomic, strong)   NSString *name;
@property (nonatomic, strong)   NSString *url;
@property (nonatomic, assign) NSInteger fileType;
@property (nonatomic, assign) NSInteger position;
@end

@interface HSQuestionTextModule : NSObject
@property (nonatomic, strong)   NSString *questionStem;
@property (nonatomic, assign) NSInteger textType;
@end

@interface HSTrunk : NSObject
@property (nonatomic, strong) NSString *body;
@property (nonatomic, strong) NSMutableArray<HSValueAttachment *> *attachments;

@end

@interface HSScore : NSObject
@property (nonatomic, strong)   NSString *questionVersionId;
@property (nonatomic, assign) double score;
@end

@interface HSTemplateSettings : NSObject // 配置 题干
@property (nonatomic, assign) NSInteger isPartView;
@property (nonatomic, strong)   NSString *content;
@property (nonatomic, strong)   NSString *audioUrl;
@property (nonatomic, assign) NSInteger questionNumber;
@property (nonatomic, assign) NSInteger infoRetail;
@property (nonatomic, strong) HSListeningAndSpeakingRule *listeningAndSpeakingRule;
@property (nonatomic, strong)   NSString *audioUrl_full;
@property (nonatomic, strong)   NSString *recordUrl;
@end

@interface HSListeningAndSpeakingRule : NSObject
@property (nonatomic, assign) NSInteger audioViews;
@property (nonatomic, assign) NSInteger lookTime;
@property (nonatomic, assign) NSInteger answerTime;
@property (nonatomic, assign) NSInteger readyTime;
@property (nonatomic, assign) NSInteger rootAudioViews;
@property (nonatomic, assign) NSInteger rootLookTime;
@property (nonatomic, assign) NSInteger rootReadyTime;
@end

@interface HSResourceH5 : NSObject
@property (nonatomic, strong)           NSString *title;
@property (nonatomic, assign)         NSInteger ref_score;
@property (nonatomic, assign)         NSInteger difficultyDegree;
@property (nonatomic, assign)         NSInteger ref_answer_time;
@property (nonatomic, assign)         NSInteger curriculum_id;
@property (nonatomic, strong)           NSMutableArray<HSPart *> *parts;
@property (nonatomic, nullable, strong) id videoReview;
@property (nonatomic, nullable, strong) id testItems;
@property (nonatomic, nullable, strong) id tags;
@property (nonatomic, strong)           NSString *id;
@property (nonatomic, nullable, strong) id versionId;
@end

@interface HSPart : NSObject
@property (nonatomic, assign)         NSInteger sid;
@property (nonatomic, strong)           NSString *module_type_name;
@property (nonatomic, strong) NSString *module_description;
@property (nonatomic, assign)         NSInteger module_anwser_time;
@property (nonatomic, strong) NSString *module_type_url;
@property (nonatomic, strong)           NSMutableArray<HSChild *> *children;
@property (nonatomic, assign)         NSInteger questionRefSorce;
@property (nonatomic, assign)         NSInteger difficultyDegree;
@end

@interface HSChild : NSObject
@property (nonatomic, assign)         NSInteger sid;
@property (nonatomic, assign)         NSInteger sort;
@property (nonatomic, strong)           NSString *stem;
@property (nonatomic, assign)         NSInteger curriculum_id;
@property (nonatomic, assign)         NSInteger qtype;
@property (nonatomic, assign)         NSInteger is_objective;
@property (nonatomic, strong)           NSString *parent_version;
@property (nonatomic, strong)           NSString *question_ref_sorce;
@property (nonatomic, strong)         HSRefInfo *ref_info;
@property (nonatomic, strong)           NSMutableArray<HSPurpleOption *> *options;
@property (nonatomic, strong)           NSMutableArray<HSChildAttachment *> *attachments;
@property (nonatomic, strong)           NSArray *knowledgePoints;
@property (nonatomic, nullable, strong) id skillPoints;
@property (nonatomic, nullable, strong) id explains;
@property (nonatomic, nullable, strong) id tags;
@property (nonatomic, strong)           NSMutableArray<HSChild *> *children;
@property (nonatomic, strong)           NSMutableArray<HSPurpleTextModule *> *textModule;
@property (nonatomic, assign)         NSInteger difficultyDegree;
@property (nonatomic, strong) NSString *question_description;
@property (nonatomic, strong) NSString *endAudioUrl;
@property (nonatomic, strong) NSString *answerAudioUrl;
@property (nonatomic, strong)           NSString *id;
@property (nonatomic, strong)           NSString *version_id;
@end

@interface HSChildAttachment : NSObject
@property (nonatomic, assign)         NSInteger file_type;
@property (nonatomic, assign)         NSInteger position;
@property (nonatomic, strong)           NSString *file_url;
@property (nonatomic, strong) NSString *cover_Url;
@end

@interface HSPurpleOption : NSObject
@property (nonatomic, strong)   NSString *id;
@property (nonatomic, strong)   NSString *stem;
@property (nonatomic, strong)   NSMutableArray<HSChildAttachment *> *attachments;
@property (nonatomic, assign) NSInteger sort;
@end

@interface HSRefInfo : NSObject
@property (nonatomic, strong)           NSArray<NSString *> *answers;
@property (nonatomic, strong) NSString *solving_idea;
@property (nonatomic, strong)           NSArray *attachments;
@property (nonatomic, strong) NSString *points;
@property (nonatomic, strong) NSString *sames;
@end

@interface HSPurpleTextModule : NSObject
@property (nonatomic, strong)   NSString *questionVersion;
@property (nonatomic, strong)   NSString *textID;
@property (nonatomic, strong)   NSString *questionStem;
@property (nonatomic, strong)   NSString *questionThinking;
@property (nonatomic, strong)   NSString *refeInformation;
@property (nonatomic, assign) NSInteger textType;
@end

@interface TextbookQuestionsModel : NSObject
@property (nonatomic, strong) NSString *resmain;
@property (nonatomic, strong) HSResource *resource;
@property (nonatomic, strong) HSResourceH5 *resource_h5;
@end

NS_ASSUME_NONNULL_END
